<?php

class SimpleMessageWorkflowNode extends RunTimeWorkflowNode
{
  
  const IN_SUBJECT = 'simple_message_workflow_node_subject';
  const IN_MESSAGE = 'simple_message_workflow_node_message';

  protected function doDeliver ()
  {
    parent::doDeliver();
    $this->complete();
  }

  public function getSubject ()
  {
    if ($this->getContainer()
      ->hasValue(self::IN_SUBJECT))
    {
      return $this->getContainer()
        ->getValue(self::IN_SUBJECT);
    }
    else
    {
      return parent::getSubject();
    }
  }

  public function getMessage ()
  {
    if ($this->getContainer()
      ->hasValue(self::IN_MESSAGE))
    {
      return $this->getContainer()
        ->getValue(self::IN_MESSAGE);
    }
    else
    {
      return parent::getMessage();
    }
  }
}